package cn.com.qingz.modules.system.controller;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.com.qingz.modules.system.model.SystemLog;
import cn.com.qingz.modules.system.model.Systemparameter;
import cn.com.qingz.modules.system.service.SystemparameterService;

@Controller
public class SystemController {

    @Autowired
    private SystemparameterService service;

    private Logger log = Logger.getLogger(SystemController.class);

    /**
     * 进入管理页面
     * @return
     */
    @RequestMapping("/index")
    public String index() {
        return "main";
    }

    @RequestMapping("/dotest")
    @ResponseBody
    public cn.com.qingz.modules.system.model.SystemLog dotest(SystemLog g) {

        //		Subject subject = SecurityUtils.getSubject();
        //		subject.getPrincipal()
        //		System.out.println(g.getLmodifytime()); 

        return g;
    }

    @RequestMapping("/addSomeThing")
    @ResponseBody
    public String addSomeThing(Systemparameter p) {

        //		Subject subject = SecurityUtils.getSubject();
        //		subject.getPrincipal()
        //		System.out.println(g.getLmodifytime()); 

        service.dosaveparameter(p);

        return "success";
    }

}
